package com.xy.net.retrofit;

import java.util.Map;

import io.reactivex.Observable;
import okhttp3.RequestBody;
import okhttp3.ResponseBody;
import retrofit2.Call;
import retrofit2.http.FieldMap;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Part;
import retrofit2.http.PartMap;
import retrofit2.http.Path;
import retrofit2.http.QueryMap;
import retrofit2.http.Url;

/**
 * Created by John on 2016/12/9.
 */

public interface ApiService {

    @GET("{url}")
    Observable<ResponseBody> asynGet(@Path("url") String url, @QueryMap Map<String, String> map);

    @POST("{url}")
    Observable<ResponseBody> asynPost(@Path("url") String url, @FieldMap Map<String, String> map);

    @POST("{url}")
    Call<ResponseBody> uploadFiles(
            @Url() String url,
            @Part("filename") String description,
            @PartMap() Map<String, RequestBody> maps);

}
